<%@ page language='java' import='java.util.*' pageEncoding='utf-8'%>
<%@page import="org.ycty.ip.IPSeeker"%>
<%@page import="net.sf.json.JSONObject"%>
<%
String path = request.getContextPath();
%>
<%
		IPSeeker ip = new IPSeeker("QQWry.Dat", "D:/qqwry");
		//获得地方名称
		String province = null;
		String city = null;
		String country = null;
		String isp = ip.getIPLocation(request.getRemoteAddr()).getArea();
		String cityname = ip.getIPLocation(request.getRemoteAddr()).getCountry();
		//截取地方名称
		String name = null;
		if(cityname.indexOf("省") !=-1){
			province=cityname.substring(0, cityname.indexOf("省"));
		}
		if(cityname.indexOf("市") !=-1){
			if(cityname.indexOf("省")!=-1){
				city=cityname.substring(cityname.indexOf("省")+1, cityname.indexOf("市"));
			}else{
			city=cityname.substring(0, cityname.indexOf("市"));
			}
		}
		else{
			country=cityname;
		} 
	JSONObject remote_ip_info = new JSONObject();
	remote_ip_info.put("ip",request.getRemoteAddr());
	remote_ip_info.put("province",province);
	remote_ip_info.put("city",city);
	remote_ip_info.put("country",country);
	remote_ip_info.put("isp",isp);
	
%>
var info=<%=remote_ip_info%>;





















































   